package com.lovo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project.bean.SaleBean;
import com.lovo.project.mapper.SaleMapper;
import com.lovo.project.service.SaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SaleServiceImpl extends ServiceImpl<SaleMapper, SaleBean> implements SaleService {
    @Autowired
    SaleMapper saleMapper;

    @Override
    public List<SaleBean> querySaleList(QueryWrapper queryWrapper) {
        List<SaleBean> list=saleMapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public void deleteSale(Integer saleId) {
        saleMapper.deleteById(saleId);
    }

    @Override
    public void insertSale(SaleBean saleBean) {
        saleMapper.insert(saleBean);
    }

    @Override
    public void updateSale(SaleBean saleBean) {
        saleMapper.updateById(saleBean);
    }
}
